//
//  MBHomeNetTool.m
//  MemberBusiness-ios
//
//  Created by cherry pu on 2018/4/24.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBHomeNetTool.h"

@implementation MBHomeNetTool

+(void)homeNetToolHomeMessageWithStoreId:(int)storeId success:(MBResponseBlock)response failure:(MBRequestFailure)failure
{
    MBLoginUserModel* userModel = [MBLoginUserModelArchieveTool userInfoUnAchieveFromFile];
    if (!userModel) {
        return;
    }
    [[MBHTTPTool sharedInstance]POST:HOME_STORE_MESSAGE params:@{@"store_id":@(storeId),@"token":userModel.token} success:^(id jsonData) {
        response([[MBHTTPResponse alloc]initWithJsonData:jsonData]);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

+(void)homeNetToolSellerMessageWithParam:(MBSellerGoodsParam*)param success:(MBResponseBlock)response failure:(MBRequestFailure)failure
{
    [[MBHTTPTool sharedInstance]POST:HOME_SELLER_MESSAGE params:param.yy_modelToJSONObject success:^(id jsonData) {
        response([[MBHTTPResponse alloc]initWithJsonData:jsonData]);
    } failure:^(NSError *error) {
        failure(error);
    }];
}

+(void)homeNetToolPostCurrentVersionSuccess:(MBResponseBlock)response failure:(MBRequestFailure)failure
{
    [[MBHTTPTool sharedInstance]POST:ACCOUNT_POST_CURRENT_VERSION params:@{@"type":@"2",@"category":@"1",@"status":@"1"} success:^(id jsonData) {
        response([[MBHTTPResponse alloc]initWithJsonData:jsonData]);
    } failure:^(NSError *error) {
        failure(error);
    }];
}


@end
